package com.jblv.frame.common.type;

/**
 * @author happyonion.yangtao
 * @version 1.0
 * @title BooleanType
 * @projectName jblv-frame
 * @packageName com.jblv.common.type
 * @description 布尔类型枚举数据
 * @date Create at 2020/4/21 17:40
 * @since jdk1.8
 */
public enum BooleanType {
    // 真类型
    TRUE(1),
    // 假类型
    FALSE(0);

    private int code;

    private BooleanType(int code) {
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public static BooleanType getBooleanType(int code) {
        BooleanType[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            BooleanType type = var1[var3];
            if (type.code == code) {
                return type;
            }
        }

        return null;
    }
}